def search_matrix(matrix, target):
    """
    查找二维矩阵中的目标值：将矩阵视为一维有序数组，进行二分查找
    matrix：m×n的二维矩阵（每行有序，每列有序，且下一行第一个元素大于上一行最后一个元素）
    target：待查找元素
    """
    if not matrix or not matrix[0]:
        return False
    m, n = len(matrix), len(matrix[0])
    left, right = 0, m * n - 1
    while left <= right:
        mid = (left + right) // 2
        # 将一维索引转换为二维坐标
        row, col = mid // n, mid % n
        if matrix[row][col] == target:
            return True
        elif matrix[row][col] < target:
            left = mid + 1
        else:
            right = mid - 1
    return False

# 测试
matrix = [[1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 60]]
print(search_matrix(matrix, 3))   # 输出：True
print(search_matrix(matrix, 13))  # 输出：False